#!/usr/bin/env bash
. "$GVM_ROOT/scripts/functions"

error_message=""

# Check for git
command -v git &> /dev/null ||
	error_message="${error_message}
Could not find git

  linux: apt-get install mercurial
  mac:   brew install mercurial
"
# Check for ar
command -v ar &> /dev/null ||
	error_message="${error_message}
Could not find binutils

  linux: apt-get install binutils
"
# Check for bison
command -v bison &> /dev/null ||
	error_message="${error_message}
Could not find bison

  linux: apt-get install bison
"
# Check for gcc
command -v gcc &> /dev/null ||
	error_message="${error_message}
Could not find gcc

  linux: apt-get install gcc
"
# Check for make
command -v make &> /dev/null ||
	error_message="${error_message}
Could not find make

  linux: apt-get install make
"
# Check for curl
command -v curl &> /dev/null ||
	error_message="${error_message}
Could not find curl

  linux: apt-get install curl
  mac:   brew install curl
"

if [ -n "$error_message" ]; then
	display_warning "$error_message"
	exit 1
else
	# All good!
	exit 0
fi
